using UnityEditor;
using UnityEngine;

namespace Gameplay.PVE.Editor
{
    [CustomEditor( typeof(RegionAttribute))]
    public class PveMapEditorInspector : UnityEditor.Editor
    {
        public override void OnInspectorGUI()
        {
            base.OnInspectorGUI();
            if (GUILayout.Button("添加路径点"))
            {
                (target as RegionAttribute).AddPoint();
            }
            if (GUILayout.Button("添加敌人"))
            {
                (target as RegionAttribute).AddEnemy();
            }
            
            if (GUILayout.Button("添加掩体"))
            {
                (target as RegionAttribute).AddObstacle();
            }
            
            if (GUILayout.Button("更新掩体"))
            {
                (target as RegionAttribute).UpdateObstacles();
            }
        }
    }
    
    [CustomEditor( typeof(RpgRegionAttribute))]
    public class RpgRegionAttributeInspector : UnityEditor.Editor
    {
        public override void OnInspectorGUI()
        {
            base.OnInspectorGUI();
            if (GUILayout.Button("添加路径点"))
            {
                (target as RpgRegionAttribute).AddPoint();
            }
        }
    }
}